package club.wx3609.images.service;

import club.wx3609.images.entity.Friend;
import club.wx3609.images.interfaces.repository.FriendRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FriendService {

    @Resource
    private FriendRepository friendRepository;

    public List<Friend> findAll(){
        return friendRepository.findAll();
    }

    public Friend addOne(Friend friend){
        return friendRepository.save(friend);
    }

    public List<Friend> findByReqPerson(String reqPerson){
        return friendRepository.findByReqPerson(reqPerson);
    }

    public List<Friend> findByResPerson(String ResPerson){
        return friendRepository.findByResPerson(ResPerson);
    }

    public Friend save(Friend friend){
        return friendRepository.save(friend);
    }

}
